package com.jdd.modules.sdk.ledcall;

import com.jdd.common.constant.JddConstant;
import com.jdd.common.constant.LedConstant;
import com.jdd.common.util.DateUtil;
import com.jdd.common.util.DateUtils;
import com.jdd.modules.sdk.LedCallInterface;
import com.jdd.modules.sdk.SdkCallInterface;
import com.jdd.modules.sdkidentifyresultpushlog.entity.DiscountCouponDetail;
import com.jdd.modules.sdkidentifyresultpushlog.entity.ParkOrderInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * author:lcy
 * since 2021/8/11 18:18
 */

@Component
@Lazy
@Slf4j
public  class FangKongLedCallInterface extends LedCallInterface {
    @Resource
    private SdkCallInterface sdkCallInterface;


    /**
     * @return
     * @Description 无牌车入口显示播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceUnlicensed(String serialNo) {
        String str = "无牌车请扫描入口二维码!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无牌车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.threeLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 军警车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceSpecial(String serialNo, String plateNo) {
        String str = plateNo + ",欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "军警车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 贵宾车入场播报
     * @author rensahngyi
     * @Date 2022-02-17
     */
    @Override
    public void EntranceWhite(String serialNo, String plateNo) {
        String str = "贵宾车"+plateNo + ",欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "贵宾车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:11
     * @Description 贵宾车过期按照临时车
     */
    @Override
    public void EntranceParkWhiteOver(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "白名单已过期，将按临时车收费", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "白名单" + plateNo + "已过期，将按临时车收费");
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:12
     * @Description 月租车过期禁止进入
     */
    @Override
    public void BanMonthOver(String serialNo, String plateNo, Date endTime, String broadcastInfo) throws Exception {
        String str = StringUtils.isNotBlank(broadcastInfo) ? broadcastInfo :
                "月租车" + plateNo + "已于" + DateUtil.formatDate(endTime, "yyyy-MM-dd") + "过期禁止入场!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:13
     * @Description 过期N天不可进入
     */
    @Override
    public void BanMonthOverDay(String serialNo, String plateNo, Date endTimes) throws Exception {
        String str = "月租车" + plateNo + "已于" + DateUtil.formatDate(endTimes, "yyyy-MM-dd") + "过期禁止入场请联系管理员!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:14
     * @Description 过期N天内可进入
     */
    @Override
    public void EnranceMonthOverCan(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "月租车" + plateNo + "月租时效已过,出场将按照临时车收费";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车过期按照临时车收费播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceMonthlyOverdue(String serialNo, String plateNo) {
        String str = "月租车" + plateNo + "月租时效已过,出场将按照临时车收费";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.oneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void MonthlyEntrance(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 黑名单禁止通行播报 如果是黑名单并且iFBroadcast为false 则限制入场
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceBlacklist(String serialNo, String plateNo) {
        String str = "黑名单车牌号," + plateNo + ",限制驶入车场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "此车为黑名单车辆", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止通行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 禁行时间段内播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void JudgeStopDay(String serialNo, String plateNo) {
        String str = "车场禁行时段内,车辆禁止入场！";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止驶入", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:18
     * @Description 储值车配置自动开闸
     */
    @Override
    public void EntranceStoredInConfig(String serialNo, String plateNo) {
        String str = "欢迎储值车" + plateNo + "光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车配置手动开闸
     */
    @Override
    public void StoredInConfig(String serialNo, String plateNo) {
        String str = "请稍后等待管理员确认!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车无配置自动开闸
     */
    @Override
    public void EntranceStoredNoConfig(String serialNo, String plateNo) {
        String str = "储值车" + plateNo + "欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntrance(String serialNo, String plateNo) {
        String str = "欢迎临时车" + plateNo + "光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车禁止入场播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryBanEntrance(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo) + "临时车辆禁止驶入!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止驶入", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场车位已满, 禁止通行播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntranceParkingFull(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo) + "临时车位已满禁止车辆驶入";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "车位已满", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止驶入", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心驾驶", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "安全离场", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * 临时车位已满 确认开闸
     *
     * @param serialNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/8/31 14:57:35
     * @version 1.0
     */
    @Override
    public void TemporaryEntranceFullConfirmOpened(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo) + "临时车位已满请等待管理员确认";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "车位已满", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止驶入", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请等待管理员确认", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车位未满配置自动开闸
     */
    @Override
    public void TemporaryEntranceInConfig(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = sdkCallInterface.getOverdueType(plateNo) + "欢迎临时车" + plateNo + "光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车位未满配置确认开闸
     */
    @Override
    public void TemporaryInConfig(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo) + "临时车请稍后等待管理员确认!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请稍后等待管理员确认", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 无牌车出场
     */
    @Override
    public void OutUnlicensed(String serialNo) {
        String str = "无牌车请扫描出口二维码!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        String threeLineStr = "无牌车";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, threeLineStr, LedConstant.threeLine);
        String fourLineStr = "请扫描出口二维码";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, fourLineStr, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 特殊车出场
     */
    @Override
    public void OutSpecial(String serialNo, String plateNo) {
        //直接抬杆
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "祝您一路顺风!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "军警车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 贵宾车出场
     */
    @Override
    public void OutParkWhite(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = plateNo + ",一路顺风!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "贵宾车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 月租车出场
     */
    @Override
    public void OutMonthly(String serialNo, String plateNo) {
        // 直接抬杆
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "祝您一路顺风!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /**
     * 月租车出场标准版
     *
     * @param daysDverdue
     * @return
     * @author renshangyi
     * @date 2022/1/18
     */
    public void OutMonthlyStandard(String serialNo, String plateNo, long daysDverdue) {
        String str3 = "小心慢行";
        String str4 = "一路顺风";
        String str = "月租车" + plateNo + "祝您一路顺风";
        if (daysDverdue <= 30 && daysDverdue > 0) {
            str = "月租车" + plateNo + "剩余天数" + daysDverdue + "天,请及时续费";
            str3 = "剩余天数" + daysDverdue + "（天）";
            str4 = "请及时续费";
        } else if (daysDverdue == 0) {
            str = "月租车" + plateNo + ",1天内过期,请及时续费";
            str3 = "月租车" + plateNo + ",1天内过期";
            str4 = "请及时续费";
        }
        // 直接抬杆
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str3, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str4, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理
     */
    @Override
    public void OutAbnormal(String serialNo, String plateNo) {
        String str = "请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录不抬杆
     */
    @Override
    public void OutAbnormalBan(String serialNo, String plateNo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, JddConstant.AdmissionRecordsCarType.NO_OPEN_MESSAGE, LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无纪录", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, JddConstant.AdmissionRecordsCarType.NO_OPEN_MESSAGE);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录免费放行
     */
    @Override
    public void OutAbnormalCan(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无纪录", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, JddConstant.AdmissionRecordsCarType.FREE_RELEASE_MESSAGE);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 停车费已支付处理
     */
    @Override
    public void OutPayParkingFee(String serialNo, String plateNo) {
        //直接抬杆
        String str = plateNo + ",已缴费,一路顺风!";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "已缴费", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 使用免费时长券/全免券/小时券的订单
     */
    @Override
    public void OutDiscount(String serialNo, String plateNo, DiscountCouponDetail discountCouponDetail) {
        //直接抬杆
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "祝您一路顺风!";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "使用" + discountCouponDetail.getCouponName(), LedConstant.fourLine);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车无入场纪录
     */
    @Override
    public void OutStoredNoInLogs(String serialNo, String plateNo) {
        String str = "未找到车辆入场记录！";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无入场纪录", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车缴费出场
     */
    @Override
    public void OutStoredPayFee(String serialNo, String plateNo, Integer unpayFee, Integer remaining, ParkOrderInfoVO parkOrderInfoVO) {
        String theParkingTime = DateUtils.turnDayHourMinuteString(String.valueOf(parkOrderInfoVO.getChargeDuration()));

        String str = "储值车" + plateNo + "本次停车" + theParkingTime + "停车费用为" + unpayFee + "元" + "余额为" + remaining + "元";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "停车费用为" + unpayFee + "元", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "本次停车" + theParkingTime, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理
     */
    @Override
    public void OutStoredChargeAbnormal(String serialNo, String plateNo) {
        String str = "未识别到车辆信息";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.oneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 播报收费信息
     */
    @Override
    public void OutShowFee(String serialNo, String plateNo, ParkOrderInfoVO parkOrderInfo) {
        String theParkingTime = DateUtils.turnDayHourMinuteString(String.valueOf(parkOrderInfo.getChargeDuration()));
        String str = plateNo + "停车费用为" + Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元" + "本次停车" + theParkingTime;
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        String chargeStr = "停车费用为" + Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, chargeStr, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "本次停车" + theParkingTime, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }


    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 播报收费信息
     */
    @Override
    public void OutMonthlyShowFee(String serialNo, String plateNo, String broadcastInfo) {
        //String str = plateNo + "停车费用为" + Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元" + "本次停车" + DateUtils.turnDayHourMinuteString(parkOrderInfo.getChargeDuration().toString());
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.twoLine);
        //String chargeStr = "停车费用为" + Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /**
     * 入场 确认开闸被拒绝
     *
     * @param serialNo
     * @param plateNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/9/1 11:29:40
     * @version 1.0
     */
    @Override
    public void RefuseCarEnter(String serialNo, String plateNo) {
        String str = "禁止入场,请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.oneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * 重复识别确认开闸播报信息
     */
    @Override
    public void repeatRecognitionConfirmOpened(String serialNo, String plateNo) {
        String str = plateNo + "重复识别";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "重复识别", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*** 功能描述: 场内码支付成功得，加上去缴费成功
     * @Author: lcy
     * @Date: 2022/1/19
     */
    @Override
    public void FieldFee(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "已缴费", LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo + ",已缴费,一路顺风");
    }

    /**
     * 临时车不收费出场
     *
     * @param serialNo
     * @param plateNo
     */
    @Override
    public void FieldFeeOut(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo + ",一路顺风");
    }

    /**
     * 重复识别确认开闸播报信息
     */
    public void customizedConfirmOpened(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "智慧出行", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "重复识别", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void outMonthlyEntrance(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    public void FieldFeeChargeDurationOut(String serialNo, String plateNo, Integer chargeDuration) {

        String theParkingTime = DateUtils.turnDayHourMinuteString(String.valueOf(chargeDuration));
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.oneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.twoLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo+"本次停车"+ theParkingTime, LedConstant.threeLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.fourLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo +"本次停车"+ theParkingTime+ ",一路顺风");
    }
}
